
package main

import (
	"fmt"
)

type user struct{
	name string
	age int
}
func main(){
	var ge interface{}
	ge=2.3
	type_cast(ge)
	ge=5
	type_cast(ge)
	ge=user{name:"jack",age:23}
	type_cast(ge)
	fmt.Println("----------end-----------")
}

func type_cast(g interface{}){
	fmt.Println("type_case ---start---")
	switch g.(type){
		case int :
		fmt.Println("typs is int")
		case float32 :
		fmt.Println("typs is float32")
		case float64 :
		fmt.Println("typs is float64")
		case user:
		fmt.Println("typs is user(struct)")
		default:
		fmt.Println("type is unkown")
	}
	fmt.Println("type_case --- end ---")
}